package br.com.rhweb.modelos;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.GenericGenerator;

@Entity
@Table(name = "tbl_unidade_de_trabalho")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class Unidade_de_Trabalho implements Serializable{

	@Id
	@GeneratedValue(generator = "increment")
	@GenericGenerator(name = "increment", strategy = "increment")
	@Column(name = "id_unidade", nullable = false)
	private int id;

	@Column(name = "descricao_unidade", length = 40, nullable = false)
	private String descricao;

	@ManyToOne(optional = true, fetch= FetchType.LAZY)
	@JoinColumn(name = "id_seceretaria")
	private Secretarias secretaria;

	@Column(name = "situacao_unidade", length = 1, nullable = true)
	private String situacao;

	@Column(name = "cep_endereco", length = 8, nullable = true)
	private String cep;

	@Column(name = "numero_endereco", length = 6, nullable = true)
	private String numeroEndereco;

	@Column(name = "complemento_endereco", length = 10, nullable = true)
	private String complementoEndereco;

	@Column(name="email_unidade", nullable=true)
	private String email;
	
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getDescricao() {
		return descricao;
	}

	public void setDescricao(String descricao) {
		this.descricao = descricao;
	}

	public Secretarias getSecretaria() {
		return secretaria;
	}

	public void setSecretaria(Secretarias secretaria) {
		this.secretaria = secretaria;
	}

	public String getSituacao() {
		return situacao;
	}

	public void setSituacao(String situacao) {
		this.situacao = situacao;
	}

	public String getCep() {
		return cep;
	}

	public void setCep(String cep) {
		this.cep = cep;
	}

	public String getNumeroEndereco() {
		return numeroEndereco;
	}

	public void setNumeroEndereco(String numeroEndereco) {
		this.numeroEndereco = numeroEndereco;
	}

	public String getComplementoEndereco() {
		return complementoEndereco;
	}

	public void setComplementoEndereco(String complementoEndereco) {
		this.complementoEndereco = complementoEndereco;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

}